<script lang="ts" setup>
import { useCountStore } from '@/store/count'
const store = useCountStore()
const count = $computed(() => store.count)
const addOne = () => {
  store.count++
}
const subOne = () => {
  store.count--
}
</script>

<template>
  <div class="count">
    <h3>当前数字: {{ count }}</h3>
    <el-button type="primary" @click="addOne">
      加1
    </el-button>
    <el-button type="primary" @click="subOne">
      减1
    </el-button>
  </div>
</template>

<route lang="yaml">
name: Count
path: /count
</route>
